#!/bin/sh
# build in arch directory for scl to use a new 
# environment (hardward/compiler) 
#
# Usage: sclbuild
#
#

echo "Running the script: sclbuild - builds scl under @PDES_ROOT@/@ARCH_ROOT@"
set -x

cd @PDES_ROOT@

if (test -d @ARCH_ROOT@) ; then

cd src/express
mv -f mkrules mkrules.bak
cp mkrules.@ARCH_ROOT@ mkrules
make clean
make install || exit 1

cd ../exppp
make clean
make install || exit 1

cd ../fedex_plus
make clean
make install || exit 1

cd @PDES_ROOT@

cd @ARCH_ROOT@

cd ofiles
# make clean
@MAKE_SDAIORBIX@
make editorCore || exit 1
make dai        || exit 1
make utils      || exit 1
@MAKE_IVFASD@
@MAKE_PROBEUI@

#cd @PDES_ROOT@/@ARCH_ROOT@

cd ../Probes

#create in ~pdevel
# create only p21read
#../bin/mkProbe -i -p ../../data/example/example.exp example

#create in ~pdevel
../bin/mkProbe @MKPROBE_OPTIONS@ ../../data/example/example.exp example || exit 1

cp ../../src/test/p21read/testfile.step example

cd ../testbuild
@MAKE_EXAMPLE_NAME@
cd ..

fi
